package com.kk.base.entity.home;

import com.kk.base.annotion.ValidateEntity;
import com.kk.base.entity.BaseEntity;
import lombok.Data;
import lombok.ToString;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.*;

/**
 * 前台用户身份证实体类
 */
@Entity
@Table(name="home_user_id_card")
@EntityListeners(AuditingEntityListener.class)
@ToString
@Data
public class HomeUserIdCard extends BaseEntity {

    @OneToOne
    @JoinColumn(name="home_user_id")
    private HomeUser homeUser;  //所属用户

    @ValidateEntity(required=true,errorRequiredMsg="姓名不能为空!")
    @Column(name="name",nullable=false)
    private String name; //姓名

    @ValidateEntity(required=true,errorRequiredMsg="身份证号不能为空!")
    @Column(name="id_card",nullable=false)
    private String idCard; //身份证号

    @ValidateEntity(required=true,errorRequiredMsg="性别不能为空!")
    @Column(name="sex",nullable=false)
    private Integer sex;  //性别



}
